package com.sugon.modules.device.consts.enums;

import cn.hutool.core.map.MapUtil;

import java.util.Map;
import java.util.TreeMap;

/**
 * @author ： YuXD
 * @description： 设备维修工单状态枚举类
 * @date ： 2020-11-29 下午 5:30
 * @version: 1.0
 */
public enum DevRepairTicketStatusEnum {

    CALL_REPAIR(1, "待维修"),
    START_REPAIR(3, "维修中"),
    END_REPAIR(4, "维修结束"),
    CLOSE(6, "关闭");

    private Integer value;

    private String desc;

    DevRepairTicketStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static Map<Integer, DevRepairTicketStatusEnum> map() {
        Map<Integer, DevRepairTicketStatusEnum> map = new TreeMap<>();
        DevRepairTicketStatusEnum[] enums = values();
        for (DevRepairTicketStatusEnum devRepairTicketStatusEnum : enums) {
            map.put(devRepairTicketStatusEnum.getValue(), devRepairTicketStatusEnum);
        }
        return map;
    }

    public static Map<String, Integer> getDescMap() {
        Map<String, Integer> map = MapUtil.newHashMap();
        DevRepairTicketStatusEnum[] enums = values();
        for (DevRepairTicketStatusEnum devRepairTicketStatusEnum : enums) {
            map.put(devRepairTicketStatusEnum.getDesc(), devRepairTicketStatusEnum.getValue());
        }
        return map;
    }

}
